package org.example.seckill.rabbitmq;

import lombok.extern.slf4j.Slf4j;
import org.example.seckill.config.RabbitMqConfig;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author woopsion
 * @date 2025-07-05
 */
@Service
@Slf4j
public class MQReceiver {
    
    @Autowired
    private RabbitTemplate rabbitTemplate;
    
    @RabbitListener(queues = "queue")
    public void receiver(Object msg){
        log.info("receiver1:接收消息 ============>"+msg);
    }
    
    
    @RabbitListener(queues = "queue")
    public void receiver2(Object msg){
        log.info("receiver2:接收消息!!!>"+msg);
    }    
    
    
    @RabbitListener(queues = "fanout_queue1")
    public void receiver3(Object msg){
        log.info("fanout_queue1_pay:接收消息!!!>"+msg);
    }    
    
    
    @RabbitListener(queues = "fanout_queue2")
    public void receiver4(Object msg){
        log.info("fanout_queue2_order:接收消息!!!>"+msg);
    }
}
